from flask import Blueprint, render_template

from service.FriendLinkService import delete_friend_link, publish_friend_link, \
    get_friend_links_page

admin_friendLink = Blueprint('admin_friendLink', __name__)
admin_friendLink.url_prefix = '/admin'


@admin_friendLink.route("/friendLink_manage/<int:page>")
def get_friend_link_page(page):
    page = get_friend_links_page(page)
    return render_template('admin/friendlink-manage.html', page=page)


@admin_friendLink.route("/friend_link_delete/<string:uuid>/<int:page>")
def friend_link_delete(uuid, page):
    page = delete_friend_link(uuid, page)
    return render_template('admin/friendlink-manage.html', page=page)


@admin_friendLink.route("/friend_link_publish/<string:uuid>/<int:page>")
def friend_link_publish(uuid, page):
    page = publish_friend_link(uuid, page)
    return render_template('admin/friendlink-manage.html', page=page)
